/*
** my_square_root.c for  in /home/georgi_v/rendu/Piscine-C-lib
** 
** Made by georgi_v
** Login   <georgi_v@epitech.net>
** 
** Started on  Fri Oct  4 10:11:07 2013 georgi_v
** Last update Fri Dec  6 18:44:19 2013 georgi_v
*/

#include "my.h"

int	my_square_root(int nb)
{
  int	number;
  int	tmp;

  number = -1;
  while (number <= nb && nb > -1)
    {
      tmp = number * number;
      if (tmp == nb)
	return (number);
      if (tmp > nb)
	return (-1);
      number++;
    }
  return (-1);
}
